﻿@using Apps.Web.Core;
@using Apps.Web;
@using Apps.Common;
@using Apps.Models.Sys;
@using Apps.Locale;
@{
    ViewBag.Title = "投料单报表";
    Layout = "~/Views/Shared/_Index_Layout.cshtml";
    List<permModel> perm = null;
}
<script src="~/Scripts/My97DatePicker/WdatePicker.js"></script>
<div class="mvctool">
    @Html.ToolButton("btnQuery", "fa fa-search", Resource.Query, ref perm, "Query", true)
</div>
<table id="List"></table>
@Html.Partial("~/Views/Shared/_Partial_AutoGrid.cshtml")

<div id="modalwindow" class="easyui-window" style="width:800px; height:400px;" data-options="modal:true,closed:true,minimizable:false,shadow:false"></div>
<script type="text/javascript">
    $(function () {
        $('#List').datagrid({
            url: '@Url.Action("GetFeedList")',
            width:SetGridWidthSub(10),
            methord: 'post',
            height: SetGridHeightSub(45),
            fitColumns: true,
            sortName: 'Id',
            sortOrder: 'desc',
            idField: 'Id',
            pageSize: 15,
            pageList: [15, 20, 30, 40, 50],
            pagination: true,
            striped: true, //奇偶行是否区分
            singleSelect: true,//单选模式
            //rownumbers: true,//行号
            columns: [[
                { field: 'Id', title: 'Id', width: 80, hidden: true },
                { field: 'FeedBillNum', title: '投料单号（业务）', width: 80, sortable: true },
                { field: 'ReleaseBillNum', title: '投料单号（系统）', width: 100, sortable: true },
                { field: 'Department', title: '投料部门', width: 70, sortable: true },
                { field: 'AssemblyPartCode', title: '总成物料', width: 80, sortable: true },
                { field: 'SubAssemblyPartCode', title: '投料物料', width: 80, sortable: true },
                //{ field: 'Lot', title: '批次号', width: 50, sortable: true },
                { field: 'FeedQty', title: '投料数量', width: 80, sortable: true, align: 'right' },
                { field: 'BoxQty', title: '箱数', width: 80, sortable: true, align: 'right' },
                { field: 'Capacity', title: '体积', width: 80, sortable: true },
                { field: 'InvName', title: '库房', width: 80, sortable: true },
                //{ field: 'SubInvId', title: '子库存', width: 80,sortable:true },
                { field: 'Lot', title: '批次号', width: 60, sortable: true },
                { field: 'Remark', title: '备注', width: 80, sortable: true },
                { field: 'PrintStaus', title: '打印状态', width: 80, sortable: true },
                //{ field: 'PrintDate', title: '打印时间', width: 80, sortable: true },
                {
                    field: 'PrintDate', title: '打印时间', width: 80, sortable: true,
                    formatter: function (value, row, index)
                    {
                        return formatterDateNoHour(value);
                    }
                },
                { field: 'PrintMan', title: '打印人', width: 80, sortable: true },
                { field: 'ConfirmStatus', title: '确认状态', width: 80, sortable: true },
                { field: 'ConfirmMan', title: '确认人', width: 80, sortable: true },
                //{ field: 'ConfirmDate', title: '确认时间', width: 80, sortable: true },
                {
                    field: 'ConfirmDate', title: '确认时间', width: 80, sortable: true,
                    formatter: function (value, row, index)
                    {
                        return formatterDateNoHour(value);
                    }
                },
                { field: 'ConfirmMessage', title: '确认信息', width: 80, sortable: true },
            ]]
        });
    });
    //ifram 返回
    function frameReturnByClose() {
        $("#modalwindow").window('close');
    }
    function frameReturnByReload(flag) {
        if (flag)
            $("#List").datagrid('load');
        else
            $("#List").datagrid('reload');
    }
    function frameReturnByMes(mes) {
        $.messageBox5s(Lang.Tip, mes);
    }
    $(function () {
        $("#btnQuery").click(function () {
            $("#List").datagrid("load");
        });
    });
</script>

